close all;
clear all;
clc;

stream = VideoReader('./1.mp4');

get(stream);
stream_frame_num = stream.NumberOfFrames;
stream_height = stream.Height
stream_width = stream.Width
%{
for i = 1 : stream_frame_num
    a = read(stream, i);
    figure;
    imshow(a);
end
%}

gray_value = 0;

frame = read(stream, 54); %53, 54 got point
gray = rgb2gray(frame);
figure;
imshow(gray);
for i = 1 : stream_height
    for j = 1 : stream_width
        k = gray(i,j);
        if k > gray_value
            coordinate = [j, i];
            gray_value = k;
        end
    end
end

figure;
imshow(gray);
hold on;
plot(coordinate(1),coordinate(2),'--rs','LineWidth',2,...
                'MarkerEdgeColor','k',...
                'MarkerFaceColor','g',...
                'MarkerSize',10)

